set(melt_lib mlt Threads::Threads)
pkg_check_modules(sdl2 IMPORTED_TARGET GLOBAL sdl2)
if(TARGET PkgConfig::sdl2)
    add_library(sdl2 ALIAS PkgConfig::sdl2)
    if(MINGW)
        list(APPEND melt_lib mingw32)
    endif()
    list(APPEND melt_lib sdl2)
endif()
add_executable(melt melt.c io.c)
target_compile_definitions(melt PRIVATE VERSION="${MLT_VERSION}")
target_link_libraries(melt ${melt_lib})
install(TARGETS melt RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
